import pandas as pd

# 定义三个 CSV 文件的路径
file1 = '002851_2024-05-01_2024-05-31.csv'
file2 = '002851_2024-06-01_2024-12-31.csv'
file3 = '002851_2025-01-01_2025-04-05.csv'

# 读取 CSV 文件
df1 = pd.read_csv(file1)
df2 = pd.read_csv(file2)
df3 = pd.read_csv(file3)

# 拼接数据
combined_df = pd.concat([df1, df2, df3], ignore_index=True)

# 输出到新的 CSV 文件
output_file = '002851.csv'
combined_df.to_csv(output_file, index=False)

print(f"数据已成功拼接并保存到 {output_file}")